package com.caochenlei.principle.dependenceInversion;

public class DependenceInversion2 {
    public static void main(String[] args) {
        Client2 client = new Client2();
        client.receive(new QQImpl());
        client.receive(new WXImpl());
    }
}

interface IReceive {
    public void getUserInfo(Integer uid);
}

class WXImpl implements IReceive {
    public void getUserInfo(Integer uid) {
        System.out.println("WX getUserInfo " + uid);
    }
}

class QQImpl implements IReceive {
    public void getUserInfo(Integer uid) {
        System.out.println("QQ getUserInfo " + uid);
    }
}

class Client2 {
    public void receive(IReceive iReceive) {
        iReceive.getUserInfo(774908833);
    }
}
